<%-- 
    Document   : 6_DealLeft
    Created on : Oct 17, 2011, 4:56:21 PM
    Author     : Administrator
--%>

<%@page import="java.text.DecimalFormat"%>
<%@page import="pojo.Deal"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import ="javax.servlet.ServletException"%>
<%@page import ="javax.servlet.http.HttpServlet"%>
<%@page import ="javax.servlet.http.HttpServletRequest"%>
<%@page import ="javax.servlet.http.HttpServletResponse"%>
<!DOCTYPE html>
<a href="../../mobile/supportmobile.html" id="aDownload" class="aDownLoad" target="_blank"></a> 
<div id="divSideDeals" class="div_ListBestPrice hide" style="display:block;">
    <div class='div_TopListBP'>
        <h3>Giá Tốt Trong Ngày</h3>
    </div> 
    <%
        //ArrayList<Deal> ds = (ArrayList<Deal>)request.getAttribute("a");
        ArrayList<Deal> ds = dao.Deal_DAO.layDealBenTrai();
        Deal dealMoi = new Deal();
        for (int i = 0; i <ds.size(); i++) {
            dealMoi=ds.get(i);
            double giaThuong=dealMoi.getGiaThuong();
            double giaDaGiam=dealMoi.getGiaDaGiam();
            double a=100-(giaDaGiam/giaThuong)*100;
            int phanTram=(int)a;
            DecimalFormat df = new DecimalFormat(",###");
            String giaThuong1= String.valueOf(df.format(giaThuong));
            String giaDaGiam1= String.valueOf(df.format(giaDaGiam));
            
        
    %>
    <div class='div_listBestPrice'>
        <div style='color:#FFFFFF' class='aListBPLine'>
            <h3><%=dealMoi.getTileSmallDeal()%> <%=phanTram%> %</h3>
            <div class='dInfoBRNew'>
                <img height='148' width='242' src='<%=dealMoi.getHinhDaiDien()%>' alt='<%=dealMoi.getTileSmallDeal()%>' />
                <div class='dSOListBRN'>
                    <div class='div_TietKiem'>
                        <strong class='styleText14'>Tiết Kiệm</strong><br/>
                        <strong class='styleText15'><%=phanTram%>%</strong>
                    </div>
                </div>
                <div class='PriceDealBRL'>
                    <div class='divPrice'>
                        <span class='styleText17'>
		Giá trị:<strong class='StyleTextGT lineHorizontal styleText13'><%=giaThuong1%></strong>
                        </span>
                        <div class='div_VND GTVND'>
                            <strong class='styleText16'>VND</strong>
                        </div>
                    </div>
                    <div class='div_infoMoney'>
                        <div class='div_TextInfoMoney'>
                            <p class='styleText14' style='padding-top:5px'>
                                <strong >Còn Lại</strong>
                                <strong class='strTextVND'>VND</strong>
                            </p>
                            <p class='pGiaTien'>
                                <strong class='styleText5'><%=giaDaGiam1%></strong>
                            </p>
                        </div>
                    </div>
                </div> 
            </div> 
            <a title='<%=dealMoi.getTileSmallDeal()%> <%=phanTram%>%'  href='xl_DealDetail?Action=view&DealID=<%=dealMoi.getId()%>' class='iIELine'><%=dealMoi.getTileSmallDeal()%><%=phanTram%>%</a>
        </div>
        <p class='pLineDotted'></p>

    </div><i class='iBtListBR'></i><span style='display:block;height:1px;width:100px;clear:both'></span>
    <%}%>
</div> 